Msgbox "This doesn't appear to be a valid zip code." & vbNewLine & vbNewLine & "Please try again.", vbExclamation + vbOKOnly, "Zip error ..."
x = InputBox("Please enter the zip code or location that you would like to display the weather for:" & vbNewLine & "e.g. 48152 or Hastings,England", "Select location ...", "48152")
Object.PersistStorage("zipcode") = x
Object_OnTimer6001
Exit Sub
Else
If IsNumeric(Object.PersistStorage("zipcode")) Then weathertemp = Left(weathertemp, InStr(weathertemp, "(")-2)
Function windangle(direction)'of course I got all these angles wrong, but fixed it by making the arrow point south ;)
Select Case direction
Case "N"
windangle=0
Case "NNE"
windangle=22
Case "NE"
windangle=45
Case "ENE"
windangle=67
Case "E"
windangle=90
Case "ESE"
windangle=112
Case "SE"
windangle=135
Case "SSE"
windangle=157
Case "S"
windangle=180
Case "SSW"
windangle=202
Case "SW"
windangle=225
Case "WSW"
windangle=247
Case "W"
windangle=270
Case "WNW"
windangle=292
Case "NW"
windangle=315
Case "NNW"
windangle=337
End Select
End Function
Function pickicon(conditions)
Select Case conditions
Case 25,31
pickicon = "finenight"
Case 29,33
pickicon = "partlycloudynight"
Case 27
pickicon = "mostlycloudynight"
Case 45
pickicon = "scatteredrainnight"
Case 47
pickicon = "scatteredthundernight"
Case 46
pickicon = "scatteredsnownight"
Case 37
pickicon="scatteredthunder"
Case 39
pickicon = "scatteredrain"
Case 28
pickicon = "mostlycloudy"
Case 23,24,32,36
pickicon = "fine"
Case 19,20,21,22
pickicon = "foggy"
Case 30,34,44
pickicon = "partlycloudy"
Case 26
pickicon = "cloudy"
Case 8,9,11
pickicon = "lightrain"
Case 1,2,10,12,40
pickicon = "heavyrain"
Case 5,6,7,18
pickicon = "snowymix"
Case 13,14,15,16, 41,42,43
pickicon = "snow"
Case 0,3,4,17,35,38
pickicon = "thunder"
Case "na"
pickicon = "unknown"
End Select
End Function
Function selecticon(conditions)
Select Case conditions
Case 25,31
selecticon = "moon"
Case 29,33
selecticon = "moonpartlycloudy"
Case 27
selecticon = "moonmostlycloudy"
Case 45
selecticon = "moonscatteredrain"
Case 47
selecticon = "moonscatteredthunder"
Case 46
selecticon = "moonscatteredsnow"
Case 9,11,39
selecticon = "scatteredrain"
Case 28
selecticon = "mostlycloudy"
Case 23,24,32,34,36
selecticon = "sunny"
Case 19,20,21,22
selecticon = "foggy"
Case 30,44
selecticon = "partlycloudy"
Case 26
selecticon = "cloudy"
Case 1,2,12,40
selecticon = "rain"
Case 5,6,7,8,10,18
selecticon = "sleet"
Case 13,14,15,16, 41,42,43
selecticon = "snow"
Case 0,3,4,17,35,37,38
selecticon = "thunder"
Case "na"
selecticon = "unknown"
End Select
End Function]]></Script><Globals><Editor><PropPane>0</PropPane><EditorLeft>199</EditorLeft><EditorTop>7</EditorTop><EditorRight>1254</EditorRight><EditorBottom>840</EditorBottom></Editor><Object><LanguageCLSID>{B54F3741-5B07-11CF-A4B0-00AA004A55E8}</LanguageCLSID><ControlCLSID>{00000000-0000-0000-0000-000000000000}</ControlCLSID><ControlObjWidth>64</ControlObjWidth><ControlObjHeight>64</ControlObjHeight><RunState>1</RunState><ManualControlLoad>0</ManualControlLoad><ScriptHostVersion>2</ScriptHostVersion></Object></Globals></DXScript>